﻿Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Data
Imports System.Xml
Imports System.Xml.XPath
Imports System.Xml.Xsl
Imports System.IO
Imports System.Net
Imports System.Text

Imports com.google.api

Imports Yahoo.API

Imports eBay.Service.Call
Imports eBay.Service.Core.Soap
Imports eBay.Service.Core.Sdk
Imports eBay.Service.Util

Partial Class _WebSearch
    Inherits System.Web.UI.Page
    Dim apiContext As New ApiContext

    Protected Sub lnkbtnSpell_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkbtnSpell.Click
        Spellword()
    End Sub
    Protected Sub lnkSpellWord_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkSpellWord.Click
        If Page.IsValid Then
            Dim _Points As New BusinessLogic.Points
            _Points.Activity = 0
            _Points.IPAddress = Request.UserHostAddress
            _Points.Comments = txtKeyword.Text
            If Session("Username") IsNot Nothing Then
                _Points.Username = Session("Username")
            Else
                _Points.Username = ""
            End If
            _Points.Save()
            Session("ResultEbay") = Nothing
            Session("GoogleResult") = Nothing

            Session("GooglePage") = 1
            Session("GoogleResultsCount") = 0
            Session("YahooPage") = 1
            Session("EbayPage") = 1

            yahooRes.PageIndex = 0
            'googleRes.PageIndex = 0
            ebayres.PageIndex = 0

            YahooResult.Visible = True
            'GetYahooSearchWebServiceResults()

            GetSuggestion()

            GoogleResult.Visible = True
            GetGoogleWebSearchWebServiceResults()
            EbayResult.Visible = True
            GetEbayResults()
            pnlspellword.Visible = False
            imgBlank.Height = 30
            imgFrame.Visible = False
            pnlHyperlinkTop.Visible = True
            pnlHyperlinkBottom.Visible = True
            pnlImage.Visible = True
            pnlImage1.Visible = False
            Session("SearchText") = txtKeyword.Text
        End If
    End Sub
    Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnSearch.Click
        If Page.IsValid Then
            Dim _Points As New BusinessLogic.Points
            _Points.Activity = 0
            _Points.IPAddress = Request.UserHostAddress
            _Points.Comments = txtKeyword.Text
            If Session("Username") IsNot Nothing Then
                _Points.Username = Session("Username")
            Else
                _Points.Username = ""
            End If

            _Points.Save()


            Session("ResultEbay") = Nothing
            Session("GoogleResult") = Nothing
            Session("GooglePage") = 1
            Session("GoogleResultsCount") = 0
            Session("YahooPage") = 1
            Session("EbayPage") = 1
            yahooRes.PageIndex = 0
            ebayres.PageIndex = 0
            YahooResult.Visible = True
            GetSuggestion()
            GoogleResult.Visible = True
            GetGoogleWebSearchWebServiceResults()
            EbayResult.Visible = True
            GetEbayResults()

            imgBlank.Height = 30
            imgFrame.Visible = False
            pnlHyperlinkTop.Visible = True
            pnlHyperlinkBottom.Visible = True
            pnlImage.Visible = True
            pnlImage1.Visible = False
            Session("SearchText") = txtKeyword.Text
        End If
    End Sub
    Private Sub Spellword()
        If txtKeyword.Text.Length > 0 Then
            Dim GoogleAPIKey As String = ConfigurationManager.AppSettings("GoogleAPIKey").ToString
            Dim GoogleWebSearchService As New GoogleSearchService
            Dim _GoogleWords = GoogleWebSearchService.doSpellingSuggestion(GoogleAPIKey, txtKeyword.Text)
            Dim IsIdentical = String.Compare(txtKeyword.Text, _GoogleWords)
            If IsIdentical Then
                If _GoogleWords IsNot Nothing Then
                    litSpellWord.Text = "Did you mean:"
                    lnkSpellWord.Text = _GoogleWords
                    lnkSpellWord.Attributes.Add("onclick", String.Format("$('{0}').value = '{1}';", txtKeyword.ClientID, _GoogleWords))
                    pnlspellword.Visible = True
                Else
                    pnlspellword.Visible = True
                    litSpellWord.Text = "Spelling is Correct"
                End If
            End If
        End If
    End Sub
    Private Sub GetGoogleWebSearchWebServiceResults()
        
    End Sub
    
    Protected Sub lnkGooglePrev_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkGooglePrev.Click
        Session("GooglePage") = Integer.Parse(Session("GooglePage").ToString()) - 1
        GetGoogleWebSearchWebServiceResults()
        pnlspellword.Visible = False
    End Sub
    Protected Sub lnkGoogleNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkGoogleNext.Click
        Session("GooglePage") = Integer.Parse(Session("GooglePage").ToString()) + 1
        GetGoogleWebSearchWebServiceResults()
        pnlspellword.Visible = False
    End Sub

    Private Sub GetYahooSearchWebServiceResults()
        Dim srch As String = ""
        If CustomCategory.SelectedValue <> "" Then
            srch = CustomCategory.SelectedText & " "
        End If
        srch &= txtKeyword.Text

        Try
            Dim YahooApiKey As String = ConfigurationManager.AppSettings("YahooAPIKey").ToString
            Dim yahoo As New YahooSearchService
            Dim _SearchResults As New ArrayList()
            Dim Count As Integer = yahooRes.PageSize
            Dim Offset As Integer = (Integer.Parse(Session("YahooPage").ToString()) - 1) * yahooRes.PageSize + 1

            Dim resultSet As Yahoo.API.WebSearchResponse.ResultSet
            resultSet = yahoo.WebSearch(YahooApiKey, txtKeyword.Text, "all", Count, Offset, "any", True, True, "en")
            For Each result As Yahoo.API.WebSearchResponse.ResultType In resultSet.Result
                Dim _TempSearchResult As New SearchResult()
                _TempSearchResult.Url = result.Url
                _TempSearchResult.Title = result.Title
                _TempSearchResult.Snippet = result.Summary
                _TempSearchResult.Cached = result.Cache.Size.ToString & "- Cached"

                _SearchResults.Add(_TempSearchResult)

            Next
            'litYahooSearchCount.Text = String.Format("Page {0} of {1}", Session("YahooPage"), resultSet.totalResultsAvailable / yahooRes.PageSize)
            'If Integer.Parse(Session("YahooPage").ToString()) = 1 Then
            'lnkYahooPrev.Visible = False
            'Else
            'lnkYahooPrev.Visible = True
            'End If
            'If Integer.Parse(Session("YahooPage").ToString()) = resultSet.totalResultsAvailable / yahooRes.PageSize Then
            'lnkYahooNext.Visible = False
            'Else
            'lnkYahooNext.Visible = True
            'End If
            'Session("ResultYahoo") = _SearchResults
            yahooRes.DataSource = _SearchResults
            yahooRes.DataBind()
        Catch ex As Exception
            yahooRes.Dispose()
            Response.Write("An error occured while searching on Yahoo, Try again!" & ex.Message)
        End Try
    End Sub
    Private Sub GetSuggestion()
        Dim _Suggestion As New BusinessLogic.Suggestion()
        _Suggestion.SubCategory = CustomCategory.SelectedValue
        yahooRes.DataSource = _Suggestion.Load()
        yahooRes.DataBind()
    End Sub
    Protected Sub yahooRes_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles yahooRes.PageIndexChanging
        yahooRes.PageIndex = e.NewPageIndex
        yahooRes.DataSource = Session("ResultYahoo")
        yahooRes.DataBind()
    End Sub
    'Protected Sub lnkYahooPrev_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkYahooPrev.Click
    '    Session("YahooPage") = Integer.Parse(Session("YahooPage").ToString()) - 1
    '    GetYahooSearchWebServiceResults()
    'End Sub
    'Protected Sub lnkYahooNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkYahooNext.Click
    '    Session("YahooPage") = Integer.Parse(Session("YahooPage").ToString()) + 1
    '    GetYahooSearchWebServiceResults()
    'End Sub

    Protected Sub CustomValidator1_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles CustomValidator1.ServerValidate
        args.IsValid = True
        If txtKeyword.Text.Length = 0 Or CustomCategory.SelectedValue.Length = 0 Then
            args.IsValid = False
        End If
    End Sub

    Private Sub SetEbayCredential()
        apiContext.ApiCredential.ApiAccount.Developer = ""
        apiContext.ApiCredential.ApiAccount.Application = ""
        apiContext.ApiCredential.ApiAccount.Certificate = ""
        apiContext.ApiCredential.eBayAccount.UserName = ""
        apiContext.ApiCredential.eBayAccount.Password = ""
        apiContext.ApiCredential.eBayToken = ""
        apiContext.SoapApiServerUrl = ""
        apiContext.SignInUrl = ""
        apiContext.EPSServerUrl = ""
        apiContext.Version = ""
        apiContext.ApiLogManager = New ApiLogManager()
        apiContext.ApiLogManager.ApiLoggerList.Add(New FileLogger(Server.MapPath(ConfigurationManager.AppSettings.Get("LogFileName")), True, True, True))
        apiContext.ApiLogManager.EnableLogging = True
        apiContext.Timeout = Convert.ToInt32(ConfigurationManager.AppSettings.Get("TimeOut").ToString)

        If Not ConfigurationManager.AppSettings.Get("EbayDevID") Is Nothing Then
            apiContext.ApiCredential.ApiAccount.Developer = ConfigurationManager.AppSettings("EbayDevID").ToString
        End If

        If Not ConfigurationManager.AppSettings.Get("EbayDevID") Is Nothing Then
            apiContext.ApiCredential.ApiAccount.Developer = ConfigurationManager.AppSettings("EbayDevID").ToString
        End If

        If Not ConfigurationManager.AppSettings.Get("EbayDevID") Is Nothing Then
            apiContext.ApiCredential.ApiAccount.Developer = ConfigurationManager.AppSettings("EbayDevID").ToString
        End If

        If Not ConfigurationManager.AppSettings.Get("EbayAppID") Is Nothing Then
            apiContext.ApiCredential.ApiAccount.Application = ConfigurationManager.AppSettings("EbayAppID").ToString
        End If

        If Not ConfigurationManager.AppSettings.Get("EbayCertID") Is Nothing Then
            apiContext.ApiCredential.ApiAccount.Certificate = ConfigurationManager.AppSettings("EbayCertID").ToString
        End If

        If Not ConfigurationManager.AppSettings.Get("EbayAuthToken") Is Nothing Then
            apiContext.ApiCredential.eBayToken = ConfigurationManager.AppSettings("EbayAuthToken").ToString
        End If

        If Not ConfigurationManager.AppSettings.Get("EbayUserID") Is Nothing Then
            apiContext.ApiCredential.eBayAccount.UserName = ConfigurationManager.AppSettings("EbayUserID").ToString
        End If

        If Not ConfigurationManager.AppSettings.Get("EbayUserPswd") Is Nothing Then
            apiContext.ApiCredential.eBayAccount.Password = ConfigurationManager.AppSettings("EbayUserPswd").ToString
        End If

        If Not ConfigurationManager.AppSettings.Get("EbayApiServerUrl") Is Nothing Then
            apiContext.SoapApiServerUrl = ConfigurationManager.AppSettings("EbayApiServerUrl").ToString.Replace("&amp;", "&")
        End If

        If Not ConfigurationManager.AppSettings.Get("SignInUrl") Is Nothing Then
            apiContext.SignInUrl = ConfigurationManager.AppSettings("SignInUrl").ToString
        End If

        If Not ConfigurationManager.AppSettings.Get("EpsServerUrl") Is Nothing Then
            apiContext.EPSServerUrl = ConfigurationManager.AppSettings("EpsServerUrl").ToString
        End If

        If Not ConfigurationManager.AppSettings.Get("Version") Is Nothing Then
            apiContext.Version = ConfigurationManager.AppSettings("Version").ToString
        End If

    End Sub
    Private Sub GetEbayResults()
        If txtKeyword.Text.Length > 0 Then
            SetEbayCredential()
            Dim apiCall As GetSearchResultsCall = New GetSearchResultsCall(apiContext)
            apiCall.SearchFlagsList = New SearchFlagsCodeTypeCollection
            'If CustomCategory.SelectedValue <> "" Then
            'apiCall.CategoryID = CustomCategory.SelectedValue
            'End If
            Dim findItems As SearchResultItemTypeCollection
            Dim _SearchResults As New ArrayList()
            Dim _SessionSearchResult As New ArrayList()
            Try
                'Session("EbayPage")

                findItems = apiCall.GetSearchResults(txtKeyword.Text)
                Dim findItem As SearchResultItemType
                Dim buyItNowPrice As String = ""
                Dim bestOfferPrice As String = ""
                Dim TimeLeft As String = ""
                'Dim i As Integer = 0
                lnkEbayPrev.Visible = False
                If findItems.ToArray.Length > 0 Then
                    For Each findItem In findItems
                        Dim _TempSearchResult As New SearchResult()
                        If Not findItem.Item.BuyItNowPrice Is Nothing Then
                            buyItNowPrice = CurrencyUtility.GetCurrencySymbol(findItem.Item.BuyItNowPrice.currencyID) & " " & FormatNumber(findItem.Item.BuyItNowPrice.Value.ToString, -1)
                        Else
                            buyItNowPrice = "-"
                        End If

                        _TempSearchResult.Image = findItem.Item.PictureDetails.GalleryURL
                        _TempSearchResult.Title = findItem.Item.Title
                        _TempSearchResult.Link = findItem.Item.ListingDetails.ViewItemURLForNaturalSearch
                        _TempSearchResult.EndTime = "End Time: " & findItem.Item.ListingDetails.EndTime
                        _TempSearchResult.Price = "Price: " & CurrencyUtility.GetCurrencySymbol(findItem.Item.SellingStatus.CurrentPrice.currencyID) & FormatNumber(findItem.Item.SellingStatus.CurrentPrice.Value.ToString, -1)
                        _TempSearchResult.Bids = "Bids: " & findItem.Item.SellingStatus.BidCount.ToString
                        _TempSearchResult.BuyItNow = "Buy It Now: " & buyItNowPrice
                        _SearchResults.Add(_TempSearchResult)
                    Next
                    lnkEbayNext.Visible = True
                Else
                    Dim _TempSearchResult As New SearchResult()
                    _TempSearchResult.Bids = "no results found"
                    _SearchResults.Add(_TempSearchResult)
                    lnkEbayNext.Visible = False
                End If

                Dim Startindex = 0
                Session("EbayPage") = 1
                Dim EndIndex = ebayres.PageSize - 1
                Dim i As Integer
                For i = Startindex To EndIndex
                    _SessionSearchResult.Add(_SearchResults(i))
                Next
            Catch ex As Exception
                Dim _TempSearchResult As New SearchResult()
                _TempSearchResult.Bids = "no results found"
                _SearchResults.Add(_TempSearchResult)
                lnkEbayNext.Text = ex.Message
                lnkEbayNext.Visible = True
            End Try
            Session("ResultEbay") = _SearchResults
            ebayres.DataSource = _SessionSearchResult
            ebayres.DataBind()
            litEbaySearchCount.Text = String.Format("Page {0} of {1}", 1, CInt(_SearchResults.Count / ebayres.PageSize))
        End If
    End Sub

    Protected Sub ebayres_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles ebayres.PageIndexChanging
        ebayres.PageIndex = e.NewPageIndex
        ebayres.DataSource = Session("ResultEbay")
        ebayres.DataBind()

    End Sub

    Protected Sub lnkEbayPrev_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkEbayPrev.Click
        Dim _SessionSearchResult As New ArrayList()
        _SessionSearchResult = Session("ResultEbay")
        Dim _SearchResults As New ArrayList()

        Dim EndIndex = (Integer.Parse(Session("EbayPage").ToString()) - 1) * ebayres.PageSize - 1
        Session("EbayPage") = Integer.Parse(Session("EbayPage").ToString()) - 1
        Dim Startindex = (Integer.Parse(Session("EbayPage").ToString()) - 1) * ebayres.PageSize

        Dim i As Integer
        For i = Startindex To EndIndex
            _SearchResults.Add(_SessionSearchResult(i))
        Next

        ebayres.PageIndex = Integer.Parse(Session("EbayPage").ToString())
        ebayres.DataSource = _SearchResults
        ebayres.DataBind()
        If Startindex <= 0 Then
            lnkEbayPrev.Visible = False
        Else
            lnkEbayPrev.Visible = True
        End If
        If EndIndex / ebayres.PageSize > (_SessionSearchResult.Count / ebayres.PageSize - 1) Then
            lnkEbayNext.Visible = False
        Else
            lnkEbayNext.Visible = True
        End If
        litEbaySearchCount.Text = String.Format("Page {0} of {1}", Session("EbayPage"), CInt(_SessionSearchResult.Count / ebayres.PageSize))
        pnlspellword.Visible = False
    End Sub
    Protected Sub lnkEbayNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkEbayNext.Click
        Dim _SessionSearchResult As New ArrayList()
        _SessionSearchResult = Session("ResultEbay")
        Dim _SearchResults As New ArrayList()

        Dim Startindex = Integer.Parse(Session("EbayPage").ToString()) * ebayres.PageSize
        Session("EbayPage") = Integer.Parse(Session("EbayPage").ToString()) + 1
        Dim EndIndex = Integer.Parse(Session("EbayPage").ToString()) * ebayres.PageSize - 1
        Dim i As Integer
        For i = Startindex To EndIndex
            _SearchResults.Add(_SessionSearchResult(i))
        Next

        ebayres.PageIndex = Integer.Parse(Session("EbayPage").ToString())
        ebayres.DataSource = _SearchResults
        ebayres.DataBind()
        If Startindex <= 0 Then
            lnkEbayPrev.Visible = False
        Else
            lnkEbayPrev.Visible = True
        End If

        If EndIndex / ebayres.PageSize > (_SessionSearchResult.Count / ebayres.PageSize - 1) Then
            lnkEbayNext.Visible = False
        Else
            lnkEbayNext.Visible = True
        End If
        litEbaySearchCount.Text = String.Format("Page {0} of {1}", Session("EbayPage"), CInt(_SessionSearchResult.Count / ebayres.PageSize))
        pnlspellword.Visible = False
    End Sub
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Request.Browser.Browser = "IE" Then
            btnSearch.Style.Add("margin-top", "-2px")
        End If
    End Sub

    Protected Sub btnaddComments_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnaddComments.Click
        Dim _Rating As New BusinessLogic.Rating
        _Rating.Website_Name = hidWebsite_Name.Value
        _Rating.Username = Session("Username").ToString()
        _Rating.Rating = Rating1.CurrentRating
        _Rating.Comments = txtAddComments.Text.Trim()
        _Rating.IPAddress = Request.UserHostAddress

        _Rating.Save()

        yahooRes.Visible = True
        ReadComments.Visible = False
        lnkBackComments.Visible = False
        pnlAddComments.Visible = False
        GetSuggestion()
    End Sub

    Private Sub BindComments()
        Dim _Rating As New BusinessLogic.Rating
        _Rating.Website_Name = hidWebsite_Name.Value
        ReadComments.DataSource = _Rating.LoadBySite()
        ReadComments.DataBind()
    End Sub

    Protected Sub yahooRes_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles yahooRes.RowCommand
        hidWebsite_Name.Value = e.CommandArgument

        If e.CommandName = "Read" Then
            If Session("Username") Is Nothing Then
                pnlAddComments.Visible = False
                litCommentsMessage.Visible = True
                litCommentsMessage.Text = "<br /><div align=""center"">Please login to post comments</div>"
            Else
                pnlAddComments.Visible = True
                litCommentsMessage.Visible = False
                txtAddComments.Text = ""
                Rating1.CurrentRating = 0
            End If
            yahooRes.Visible = False
            ReadComments.Visible = True
            lnkBackComments.Visible = True

            BindComments()
        End If
    End Sub
    Protected Function FixCommentLength(ByVal _Comments As String) As String
        Dim CommentsLength As Integer = CInt(ConfigurationManager.AppSettings("CommentsLength"))
        If _Comments.Length > CommentsLength + 2 Then
            Return _Comments.Substring(0, CommentsLength) & "..."
        Else
            Return _Comments
        End If
    End Function
    Protected Sub ReadComments_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles ReadComments.PageIndexChanging
        ReadComments.PageIndex = e.NewPageIndex
        BindComments()
    End Sub

    Protected Sub lnkBackComments_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkBackComments.Click
        yahooRes.Visible = True
        ReadComments.Visible = False
        lnkBackComments.Visible = False
        pnlAddComments.Visible = False
        GetSuggestion()
        ReadComments.PageIndex = 0
    End Sub

    Protected Function RestrictGoogleLinkSize(ByVal _Link As String, ByVal _Title As String) As String
        Dim GoogleLength As Integer = CInt(ConfigurationManager.AppSettings("GoogleLength"))
        Dim _Anchar = "<a href=""{0}"" target=""_blank"" title=""{2}"" >{1}</a>"
        If _Title.Length > GoogleLength + 2 Then
            Return String.Format(_Anchar, _Link, _Title.Substring(0, GoogleLength) & "...", _Title)
        Else
            Return String.Format(_Anchar, _Link, _Title, _Title)
        End If
    End Function

    Protected Function RestrictLinkSize(ByVal _Link As String) As String
        Dim _Anchar = "<div title=""{0}"" >{1}</div>"
        If _Link.Length > 30 Then
            Return String.Format(_Anchar, _Link, _Link.Substring(0, 28) & "...")
        Else
            Return String.Format(_Anchar, _Link, _Link)
        End If
    End Function

    Protected Function CreateCommentsLink(ByVal _Text As String, ByVal _Link As String)
        Dim _Anchar = "<a href=""{0}"" target=""_blank"" style=""color:#0000FF;"" title=""{0}"" >{1}</a>"
        Return String.Format(_Anchar, _Link, _Text)
    End Function

    Public Class SearchResult
        Private _Image As String
        Property Image() As String
            Get
                Return _Image
            End Get
            Set(ByVal value As String)
                _Image = value
            End Set
        End Property

        Private _Title As String
        Property Title() As String
            Get
                Return _Title
            End Get
            Set(ByVal value As String)
                _Title = value
            End Set
        End Property

        Private _Link As String
        Property Link() As String
            Get
                Return _Link
            End Get
            Set(ByVal value As String)
                _Link = value
            End Set
        End Property

        Private _EndTime As String
        Property EndTime() As String
            Get
                Return _EndTime
            End Get
            Set(ByVal value As String)
                _EndTime = value
            End Set
        End Property

        Private _Price As String
        Property Price() As String
            Get
                Return _Price
            End Get
            Set(ByVal value As String)
                _Price = value
            End Set
        End Property

        Private _Bids As String
        Property Bids() As String
            Get
                Return _Bids
            End Get
            Set(ByVal value As String)
                _Bids = value
            End Set
        End Property

        Private _BuyItNow As String
        Property BuyItNow() As String
            Get
                Return _BuyItNow
            End Get
            Set(ByVal value As String)
                _BuyItNow = value
            End Set
        End Property

        Private _Snippet As String
        Property Snippet() As String
            Get
                Return _Snippet
            End Get
            Set(ByVal value As String)
                _Snippet = value
            End Set
        End Property

        Private _Cached As String
        Property Cached() As String
            Get
                Return _Cached
            End Get
            Set(ByVal value As String)
                _Cached = value
            End Set
        End Property

        Private _Url As String
        Property Url() As String
            Get
                Return _Url
            End Get
            Set(ByVal value As String)
                _Url = value
            End Set
        End Property
    End Class
End Class